import 'package:ad_plugin/ad_params.dart';
import 'package:ad_plugin/ad_source.dart';

/// FileName ad_manager
/// @Author zhuqingfang
/// @Date 2022/9/19 11:09 上午
/// @Description global ad manager

///global ad params manager
///广告全局参数管理
class AdGlobalParamsManager {
  AdGlobalParamsManager._();

  static final AdGlobalParamsManager _instance = AdGlobalParamsManager._();

  static AdGlobalParamsManager get instance => _instance;

  //全局参数
  final AdGlobalParams _adGlobalParams = AdGlobalParams();

  setAdAppId({required String adAppId}) => _adGlobalParams.adAppId = adAppId;

  setAdAppKey({required String adAppKey}) => _adGlobalParams.adAppKey = adAppKey;

  setUserId({required String userId}) => _adGlobalParams.userId = userId;
  setAdSource({required AdSource adSource}) => _adGlobalParams.adSource = adSource;

  setDeviceId({required String deviceId}) => _adGlobalParams.deviceId = deviceId;

  setOnlineServer({required String onLineServer}) => _adGlobalParams.onLineServer = onLineServer;

  setDebugServerOpenState({required bool isDebugServerOpen}) => _adGlobalParams.isDebugServerOpen = isDebugServerOpen;

  setLogOpenState({required bool isLogOpen}) => _adGlobalParams.isLogOpen = isLogOpen;

  setChannel({required String channel}) => _adGlobalParams.channel = channel;

  setSubChannel({required String subChannel}) => _adGlobalParams.subChannel = subChannel;


  String getAppId() => _adGlobalParams.appId;

  String getAppSecret() => _adGlobalParams.appSecret;

  String getAdAppId() => _adGlobalParams.adAppId;

  String getAdAppKey() => _adGlobalParams.adAppKey;

  String? getUseId() => _adGlobalParams.userId;

  String? getDeviceId() => _adGlobalParams.deviceId;

  AdSource? getAdSource() => _adGlobalParams.adSource;

  String? getOnlineServer() => _adGlobalParams.onLineServer;

  bool? getDebugServerOpenState() => _adGlobalParams.isDebugServerOpen;

  bool? getLogOpenState() => _adGlobalParams.isLogOpen;

  String? getChannel() => _adGlobalParams.channel;

  String? getSubChannel() => _adGlobalParams.subChannel;
}

/// ad init manager
class AdInitManager {
  AdInitManager._();

  static final AdInitManager _instance = AdInitManager._();

  static AdInitManager get instance => _instance;

  ///preserve
  void init(){

  }
}
